<div id="content">
    <div class="container_box" style="margin-right:20px">
        <div class="row cpInfo">
            <div smart-include="project/views/sub-header.tpl.html"></div>
            <div class="col-xs-12 hidden-xs">
                <div class="line"></div>
            </div>
        </div>
        <div class="clearfix margin-bottom-10 row">
            <div class="col-sm-2 margin-bottom-10">
                <a class="btn btn-labeled btn-primary" data-toggle="modal" data-target="#addAlert"> <span class="btn-label"><i class="glyphicon glyphicon-plus"></i></span>添加预算和成本</a>
            </div>
            <div class="col-sm-3">
                <select class="form-control" ng-model="paginationConf.projectid" ng-change="sends()">
                    <option class="role" value="">全部</option>
                    <option class="role" ng-repeat="list in projects" value="{{list.id}}">{{list.name}}</option>
                </select>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
                <thead>
                <tr>
                    <th style="width: 10%">操作</th>
                    <th class="text-align-center">项目</th>
                    <th class="text-align-center">载体名称</th>
                    <th class="text-align-center">设计值</th>
                    <th class="text-align-center">换算值</th>
                    <th class="text-align-center">实际用量</th>
                    <th class="text-align-center">时间</th>
                    <!--<th class="text-align-center">fid</th>-->
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="data in budget">
                    <td>
                        <button class='btn btn-xs btn-default' uib-tooltip='编辑' tooltip-append-to-body='true' data-toggle="modal" data-target="#editAlert" ng-click="Edit_pro(data)"><i class='fa fa-pencil'></i></button>
                        <button class='btn btn-xs btn-default' uib-tooltip='删除' tooltip-append-to-body='true'data-toggle="modal" data-target="#delAlert" ng-click="showDelDialog(data.id)"><i class='fa fa-times'></i></button>
                        </button>
                    </td>
                    <td class="text-align-center">{{data.proname}}</td>
                    <td class="text-align-center">{{data.name}}</td>
                    <td class="text-align-center">{{data.design_num}}</td>
                    <td class="text-align-center">{{data.equ_num}}</td>
                    <td class="text-align-center">{{data.actural_num}}</td>
                    <td class="text-align-center">{{data.time}}</td>
                    <!--<td class="text-align-center">{{data.fid}}</td>-->
                </tr>
                </tbody>
            </table>
        </div>
        <!-- end widget content -->
        <div class="dt-toolbar-footer">
            <tm-pagination conf="paginationConf"></tm-pagination>
        </div>

        <div class="modal fade" id="addAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                        <h4 class="modal-title">添加预算成本</h4>
                    </div>
                    <div class="modal-body">
                        <form  class="form-horizontal">
                            <div class="form-group margin-top-10">
                                <label class="col-sm-2 control-label">选择项目</label>
                                <div class="col-sm-10">
                                    <select class="form-control" ng-model="addobj.projectid">
                                        <option class="role" ng-repeat="list in projects" value="{{list.id}}">{{list.name}}</option>
                                    </select>
                                    <span style="color: red; position: absolute; top: 0; right: 0">*</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">载体名称</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="addobj.name" class="form-control ng-pristine ng-untouched ng-valid" placeholder="项目载体">
                                    <span style="color: red; position: absolute; top: 0; right: 0">*</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">设计值</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="addobj.design_num" class="form-control ng-pristine ng-untouched ng-valid" placeholder="设计值">
                                    <span style="color: red; position: absolute; top: 0; right: 0">*</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">换算值</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="addobj.equ_num" class="form-control ng-pristine ng-untouched ng-valid" placeholder="换算值">
                                    <span style="color: red; position: absolute; top: 0; right: 0">*</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">实际用量</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="addobj.actural_num" class="form-control ng-pristine ng-untouched ng-valid" placeholder="实际用量">
                                    <span style="color: red; position: absolute; top: 0; right: 0">*</span>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button class="btn btn-default"data-dismiss="modal">关闭</button>
                        <button class="btn btn-primary" ng-click="sure_add()">提交</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
        <div class="modal fade in" id="editAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                        <h4 class="modal-title" id="myModalLabel">编辑</h4>
                    </div>
                    <div class="modal-body">
                        <form  class="form-horizontal">

                            <div class="form-group">
                                <label class="col-sm-2 control-label">项目名称</label>
                                <div class="col-sm-10">
                                    <!-- <select ng-model="editprojectid" class="form-control" disabled>
                                        <option value="{{list.id}}" ng-repeat = "list in projects">{{list.name}}</option>
                                    </select> -->
                                    <input type="text" ng-disabled="true" ng-model="editprojectid" class="form-control ng-pristine ng-untouched ng-valid" placeholder="项目名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">载体名称</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-disabled="true" ng-model="editname" class="form-control ng-pristine ng-untouched ng-valid" placeholder="项目载体">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">设计值</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="editobj.design_num" class="form-control ng-pristine ng-untouched ng-valid" placeholder="设计值">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">换算值</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="editobj.equ_num" class="form-control ng-pristine ng-untouched ng-valid" placeholder="换算值">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">实际用量</label>
                                <div class="col-sm-10">
                                    <input type="text" ng-model="editobj.actural_num" class="form-control ng-pristine ng-untouched ng-valid" placeholder="实际用量">
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button class="btn btn-default"data-dismiss="modal">关闭</button>
                        <button class="btn btn-primary" ng-click="sure_edit()">提交</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
        <div class="modal fade in" id="delAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            ×
                        </button>
                        <h4 class="modal-title">信息</h4>
                    </div>
                    <div class="modal-body">
                        <p>
                            您确实要删除这条数据吗？
                        </p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">
                            关闭
                        </button>
                        <button type="button" class="btn btn-primary" ng-click="sure_del()">
                            确认
                        </button>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
        <!-- /.modal-dialog -->
    </div>
</div>